package com.css.dzj.dzjjcss.modules.press.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/**
 * 催办信息表
 *
 * @author Leon
 */
@Entity
@Table(name = "PRESS", schema = "DZJJCSS", catalog = "")
public class Press {
    private String id;
    /** 催办机构 **/
    private String orgName;
    /** 催办内容 **/
    private String content;
    private String creater;
    private Date createTime;
    private String linkId;
    private String linkType;
    private String status;
    private String delFlag;
    private String title;

    @Id
    @Column(name = "ID")
    /*@GeneratedValue(generator = "idGenerator")
    @GenericGenerator(name = "idGenerator", strategy = "com.css.dzj.dzjjcss.common.util.SnowflakeId")*/
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "ORG_NAME")
    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    @Basic
    @Column(name = "CONTENT")
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "CREATER")
    public String getCreater() {
        return creater;
    }

    public void setCreater(String creater) {
        this.creater = creater;
    }

    @Basic
    @Column(name = "CREATE_TIME")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "LINK_ID")
    public String getLinkId() {
        return linkId;
    }

    public void setLinkId(String linkId) {
        this.linkId = linkId;
    }

    @Basic
    @Column(name = "LINK_TYPE")
    public String getLinkType() {
        return linkType;
    }

    public void setLinkType(String linkType) {
        this.linkType = linkType;
    }

    @Basic
    @Column(name = "STATUS")
    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Basic
    @Column(name = "DEL_FLAG")
    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    @Basic
    @Column(name = "TITLE")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Press press = (Press) o;

        if (id != null ? !id.equals(press.id) : press.id != null) return false;
        if (orgName != null ? !orgName.equals(press.orgName) : press.orgName != null) return false;
        if (content != null ? !content.equals(press.content) : press.content != null) return false;
        if (creater != null ? !creater.equals(press.creater) : press.creater != null) return false;
        if (createTime != null ? !createTime.equals(press.createTime) : press.createTime != null) return false;
        if (linkId != null ? !linkId.equals(press.linkId) : press.linkId != null) return false;
        if (linkType != null ? !linkType.equals(press.linkType) : press.linkType != null) return false;
        if (status != null ? !status.equals(press.status) : press.status != null) return false;
        if (delFlag != null ? !delFlag.equals(press.delFlag) : press.delFlag != null) return false;
        if (title != null ? !title.equals(press.title) : press.title != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (orgName != null ? orgName.hashCode() : 0);
        result = 31 * result + (content != null ? content.hashCode() : 0);
        result = 31 * result + (creater != null ? creater.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (linkId != null ? linkId.hashCode() : 0);
        result = 31 * result + (linkType != null ? linkType.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (delFlag != null ? delFlag.hashCode() : 0);
        result = 31 * result + (title != null ? title.hashCode() : 0);
        return result;
    }
}
